#ifndef __BPWM_NUVOTON_H
#define __BPWM_NUVOTON_H

#include "stdint.h"
#include "stdio.h"

#define BPWM_CH0_MASK 0x01
#define BPWM_CH1_MASK 0x04

typedef enum {
	BPWM_PERIPHERAL_0,
	BPWM_PERIPHERAL_1
} BPWM_AVAILABLE_LIST;

void BPWMInit(BPWM_AVAILABLE_LIST bpwm);
void BPWMSetEnable(BPWM_AVAILABLE_LIST bpwm, uint8_t newStatus);
void BPWMSetFre(BPWM_AVAILABLE_LIST bpwm, uint32_t fre);
void BPWMSetDuty(BPWM_AVAILABLE_LIST bpwm, uint16_t duty, uint8_t ch);
uint32_t BPWMGetFre(BPWM_AVAILABLE_LIST bpwm);
double BPWMGetFreReal(BPWM_AVAILABLE_LIST bpwm);
uint16_t BPWMGetDuty(BPWM_AVAILABLE_LIST bpwm, uint16_t ch);
uint8_t BPWMGetOnOff(BPWM_AVAILABLE_LIST bpwm);

#endif
